<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>资料-个人中心-魔步网</title>
<?php include_once(VIEWPATH."public/header_title.php");?>
<link href="<?php echo _get_cfg_path('css')?>base.css" type="text/css" rel="stylesheet" />
<link href="<?php echo _get_cfg_path('css')?>common.css" type="text/css" rel="stylesheet" />
<link href="<?php echo _get_cfg_path('lib')?>uploadify/uploadify.css" type="text/css" rel="stylesheet" />
<!--[if IE 6]>
<script src="js/DD_belatedPNG.js" type="text/javascript" ></script>
<script>DD_belatedPNG.fix('a,img');</script>
<![endif]-->
</head>
<body>
<?php include_once(VIEWPATH."public/header.php");?>
<div class="mainbody" id="mainbody">
    <div class="container mrgB30">
        <div class="member clearfix">
            <?php include_once(VIEWPATH."m/public/left_menu.php");?>
            <div class="fr uc_content">
            	<?php include_once(VIEWPATH."m/public/notice.php");?>
                <div class="clearfix uitopg">
                	<div class="fl um_uitop">
                    	<form method="post" action="" id="xtform">
                            <div class="authent">
                            	<div class="aut_bti">个人资料
                                <?php if(FALSE == $hasAvatar){?>
                                    <a href="/m/model" title="返回" style="float:right">返回</a>
                                <?php }?></div>
                                <?php echo validation_errors('<div class="error">', '</div>');?>
                                <table class="aut_tab profile" width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td>
                                            <a class="info_tab" href="<?php echo $infoUrl?>">基本信息</a>
                                            <a class="info_tab info_tab_on" href="<?php echo $picUrl?>">图片设置</a>
                                            <?php if(FALSE == $hasAvatar) :?>  
	                                            <a class="info_tab" href="<?php echo $avatarUrl?>">头像设置</a>
	                                            <a class="info_tab" href="<?php echo $workUrl?>">作品管理</a>
                                            <?php else :?>
                                            	<a class="info_tab" href="<?=$avatarUrl?>">头像设置</a>
                                            <?php endif;?>
                                        </td>
                                    </tr>
                                </table>
                                <table class="aut_tab profile" width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                      <td width="86">形象照片</td>
                                      <td colspan="3">
                                      <div id="previews" class="drsMoveHandle">
                                          <img id="show_idnoimg1" border=0 src='<?php if(!empty($o['showimg'])) echo '/'.$o['showimg'];?>'>
                                      </div>
                                          <div class="f_note">
                                              <p>尺寸：248×324像素</p>
                                              <input type="hidden"  name="showimg" id="showimg" value="<?=$o['showimg']?>">
                                              <em><i class="icoPro16"></i>请上传黑白照片, 上传图片大小不能超过1M</em>
                                              <div class="file_but">
                                                  <input name="showimg_upload" value="选择照片" type-data="形象照片" length-data="248" height-data="324" imgid-data="show_idnoimg1" imgval-data="showimg" class="cut_pic showimg_upload" type="button">
                                              </div>
                                          </div><br>
                                          <div id="show_showimg">
                                              <?php if($o['showimg']):?>
                                                <a href="<?='/'.$o['showimg']?>" target="_blank">查看</a>
                                              <?php endif?>
                                          </div>
                                      </td>
                                    </tr>
                                    <tr>
                                      <td></td>
                                      <td colspan="3">
                                      <div id="previews" class="drsMoveHandle">
                                          <img id="show_idnoimg2" border=0 src='<?php if(!empty($o['showimg2'])) echo '/'.$o['showimg2'];?>'>
                                      </div>
                                          <div class="f_note">
                                              <p>尺寸：248×324像素</p>
                                              <input type="hidden"  name="showimg2" id="showimg2" value="<?=$o['showimg2']?>">
                                              <em><i class="icoPro16"></i>请上传彩色照片, 上传图片大小不能超过1M</em>
                                              <div class="file_but">
                                              	<input name="showimg_upload" value="选择照片" type-data="形象照片" length-data="248" height-data="324" imgid-data="show_idnoimg2" imgval-data="showimg2" class="cut_pic showimg_upload" type="button">
                                              </div>
                                          </div>
                                          <div id="show_showimg2">
                                              <?php if($o['showimg2']):?>
                                                <a href="<?='/'.$o['showimg2']?>" target="_blank">查看</a>
                                              <?php endif?>
                                          </div>
                                      </td>
                                    </tr>
                                    <?php if($o['usertype']==1):?>
                                    <!-- <tr>
                                      <td width="86">近照</td>
                                      <td colspan="3">
                                      <div id="previews" class="drsMoveHandle">
                                          <img id="show_idnoimg3" border=0 src='<?php if(!empty($o['com_logo'])) echo '/'.$o['com_logo'];?>'>
                                      </div>
                                          <div class="f_note">
                                             
                                              <input type="hidden"  name="recent_photo" id="recent" value="<?=$o['recent_photo']?>" />
                                              <em><i class="icoPro16"></i>在个人主页上显示, 上传图片大小不能超过1M</em>
                                              <div class="file_but">
                                                  <input name="showimg_upload" value="选择照片" type-data="近照" length-data="300" height-data="300" imgid-data="show_idnoimg3" imgval-data="recent" class="cut_pic showimg_upload" type="button">
                                              </div>
                                          </div>
                                          <div id="recent_photo">
                                              <?php if($o['recent_photo']):?>
                                                <a href="<?='/'.$o['recent_photo']?>" target="_blank">查看</a>
                                              <?php endif?>
                                          </div>
                                      </td>
                                    </tr>
                                    <tr>
                                      <td width="86">模特卡</td>
                                      <td colspan="3">
                                      <div id="previews" class="drsMoveHandle">
                                          <img id="show_idnoimg4" border=0 src='<?php if(!empty($o['com_logo'])) echo '/'.$o['com_logo'];?>'>
                                      </div>
                                          <div class="f_note">
                                           
                                              <input type="hidden"  name="card" id="card" value="<?=$o['card']?>">
                                              <em><i class="icoPro16"></i>在个人主页上显示, 上传图片大小不能超过1M</em>
                                              <div class="file_but">
                                              	<input name="showimg_upload" value="选择照片" type-data="模特卡" length-data="300" height-data="300" imgid-data="show_idnoimg4" imgval-data="card" class="cut_pic showimg_upload" type="button">
                                              </div>
                                          </div>
                                          <div id="show_card">
                                              <?php if($o['card']):?>
                                                <a href="<?='/'.$o['card']?>" target="_blank">查看</a>
                                              <?php endif?>
                                          </div>
                                      </td>
                                    </tr> -->
                                    <tr>
                                      <td width="86">近照</td>
                                      <td colspan="3">
                                      <div id="previews" class="drsMoveHandle">
                                          <img id="show_idnoimg3" border=0 src='<?php if(!empty($o['recent_photo'])) echo '/'.$o['recent_photo'];?>'>
                                      </div>
                                          <div class="f_note">
                                             
                                              <input type="hidden"  name="recent_photo" id="recent" value="<?=$o['recent_photo']?>" />
                                              <em><i class="icoPro16"></i>在个人主页上显示, 上传图片大小不能超过1M</em>
                                              <div class="file_but">
                                                  <input id="photo_upload" name="photo_upload" value="选择照片" class="inp_file" type="file" />
                                              </div>
                                          </div>
                                          <div id="recent_photo">
                                              <?php if($o['recent_photo']):?>
                                                <a href="<?='/'.$o['recent_photo']?>" target="_blank">查看</a>
                                              <?php endif?>
                                          </div>
                                      </td>
                                    </tr>
                                    <tr>
                                      <td width="86">模特卡</td>
                                      <td colspan="3">
                                      <div id="previews" class="drsMoveHandle">
                                          <img id="show_idnoimg4" border=0 src='<?php if(!empty($o['card'])) echo '/'.$o['card'];?>'>
                                      </div>
                                          <div class="f_note">
                                           
                                              <input type="hidden"  name="card" id="card" value="<?=$o['card']?>">
                                              <em><i class="icoPro16"></i>在个人主页上显示, 上传图片大小不能超过1M</em>
                                              <div class="file_but">
                                                  <input id="card_upload" name="card_upload" value="选择照片" class="inp_file" type="file" />
                                              </div>
                                          </div>
                                          <div id="show_card">
                                              <?php if($o['card']):?>
                                                <a href="<?='/'.$o['card']?>" target="_blank">查看</a>
                                              <?php endif?>
                                          </div>
                                      </td>
                                    </tr>
                                    <?php endif?>
                                    <tr>
                                      <td width="86">主页背景图</td>
                                      <td colspan="3">
                                                    <div id="previews" class="drsMoveHandle">
                                          <img id="show_idnoimg5" border=0 src='<?php if(!empty($o['bgimg'])) echo '/'.$o['bgimg'];?>'>
                                      </div>
                                          <div class="f_note">
                                              <p>尺寸：1100×430像素</p>
                                              <input type="hidden"  name="bgimg" id="bgimg" value="<?=$o['bgimg']?>">
                                              <em><i class="icoPro16"></i>在个人主页上显示, 上传图片大小不能超过1M</em>
                                              <div class="file_but">
                                              	<input name="showimg_upload" value="选择照片" type-data="主页背景图" length-data="1100" height-data="430" imgid-data="show_idnoimg5" imgval-data="bgimg" class="cut_pic showimg_upload" type="button">
                                              </div>
                                          </div>
                                          <div id="show_bgimg">
                                              <?php if($o['bgimg']):?>
                                                <a href="<?='/'.$o['bgimg']?>" target="_blank">查看</a>
                                              <?php endif?>
                                          </div>
                                      </td>
                                    </tr>
                                    <tr>
                                      <td style="padding:20px 0;" valign="top">视&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;频</td>
                                      <td colspan="3">
                                      	<ul class="addons_hd_tab bbor">
                                      		<li class="bor bg vedio_active">
                                      			<a href="javascript:void(0);" class="upload-btn" data-role="button" data-rel="upload-btn" class="c_tx2">本地上传</a>
                                      		</li>
                                      		<li class="bor2 bg2">
                                      			<a href="javascript:void(0);" class="add-link" data-role="button" data-rel="add-link" class="c_tx2">添加视频</a>
                                      		</li>
                                      	</ul>
                                      	<div class="upload_div">
                                      		<form action="/m/info/upload" method="post" enctype="multipart/form-data">
												<div id="queue"></div>
												<input id="file_upload" name="file_upload" type="file" multiple="true"/>
											</form>
											<div id="upload_file_show">
											</div>
											<input type="hidden" id="uploadvedio_path" name="upload_video"/>
                                      	</div>
                                      	<div class="link_div">
                                      		<input type="text" style="width:100%;height:19px;" name="video" placeholder="请输入/粘贴视频地址" data-role="video-url" class="textinput input_url muted"/>
                                      	</div>
                                      </td>
                                      
                                      
                                      <!-- <td style="padding:20px 0;" colspan="3">                             
                                          <input style="width:470px;margin-bottom:10px;" type="input" class="txt" name="video" id="video" value="<?=$o['video']?>" placeholder="视频地址"/>
                                          <p>注：复制优酷、土豆、爱奇艺等视频网站中分享中flash地址或者通用代码下的src中的内容</p>
                                          <img src="<?php echo _get_cfg_path('images')?>video_prompt.png"/>
                                          <!--<em><i class="icoPro16"></i>在个人主页上显示, 上传图片大小不能超过1M</em>
                                              <div class="file_but">
                                                  <input id="video_upload" name="video_upload" value="" class="inp_file" type="input"/>
                                              </div>-->                                
                                          <!--<div id="show_video">
                                              <?php if($o['video']):?>
                                                <a href="<?='/'.$o['video']?>" target="_blank">下载查看</a>
                                              <?php endif?>
                                          </div>-->
                                     <!-- </td> -->
                                    </tr>
                                </table>
                                <table class="aut_tab profile" width="100%" border="0" cellspacing="0" cellpadding="0">
                                	<tr style="border-bottom:none;">
                                      <td width="80" style="height:80px">&nbsp;</td>
                                      <td colspan="3">
                                          <input name="submit" type="submit" class="but pri_video_sub" value="保存"/>
                                          <!--<input name="" type="button" class="but but_reset" value="预览"/>-->
                                      </td>
                                    </tr>
                                </table>
                            </div>
                    	</form>
                    </div>
                    <div class="fr um_wind">
                    	<?php include_once(VIEWPATH."m/public/right.php");?>
                    </div>
                </div>
            </div>
        </div>
        <div class="help_bottom"></div>
    </div> 
</div>

<!-- 弹出层 -->
<div class="popover-mask"></div>
<div class="popover complaint popover_works" style="height:auto;margin:-260px 0 0 -230px;">
    <div class="compl_top">
        <span class="fl" id="X-title">添加图片</span>
        <a href="javascript:;" id="TX-win-close" title="关闭" class="close fr">×</a></div>
  <div class="compl_con">
      <form action="/public/upload/catupload" method="post" id="catupload_form" enctype="multipart/form-data">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <input type="hidden" name="albumid" id="albumid" value=""/>
            <input type="hidden" name="agid" id="agid" value="<?=$this->input->get('agid')?>"/>
            <tr><td height="10"></td></tr>
            <tr>
              <td width="80"><font id="pic_label">照片：</font></td>
              <td>
              	<div class="filebox" style="height:91px;">
              	
              	<input type="hidden" id="show_cat_img_width"/>
              	<input type="hidden" id="show_cat_img_height"/>
              	
              	 <input type="hidden" name="width" id="length_size" />
              	 <input type="hidden" name="height" id="height_size" />
              	 <input type="hidden" name="rel_width" id="rel_width_size"/>
              	 <input type="hidden" name="rel_height" id="rel_height_size"/>
              	 <input type="hidden" id="img_url" />
              	 <input type="hidden" id="img_val" />
                 <div class="upload_btn photo_left_bg" style="top:0px;">
                    <a href="javascript:" style="text-align:center;margin-top:10px;">选择图片<input type="file" onChange="catimg_upload(this)" id="cover" name="cover"></a>
                    <br/>
                    <span style="margin-left:20px;">支持JPG/PNG/GIF，上传图片大小不能超过1M</span>
                 </div>
              	   <div class="left fl">
                     <div id="localImag"><img id="preview1" src="" style="display:none;"/></div>
                     <!--通过生成尺寸和旋转角度 后台获取尺寸和旋转角度再进行裁剪-->
                     <input id="id_top" type="hidden" name="top" value="0">  <!--x轴-->
                     <input id="id_left" type="hidden" name="left" value="0"><!--y轴-->
                     <input id="id_right" type="hidden" name="right" value="0"><!--w轴-->
                     <input id="id_bottom" type="hidden" name="bottom" value="0"><!--h轴-->
                     <input id="id_widthPro" type="hidden" name="widthPro" value=""><!--宽度比例，原：现-->
                     <input id="id_heightPro" type="hidden" name="heightPro" value=""><!--高度比例，原：现-->
                     <input id="rotation" type="hidden" value="0" name="rotation">
                   </div>
                   
                   <!-- <a href="javascript:void(0);" class="reset_img" title="重选图片">
	                <img src="<?php echo _get_cfg_path('images')?>reset.png"/>
	               </a> -->
                </div>
              </td>
            </tr>
            <tr><td height="10"></td></tr>
            <tr><td height="10"></td></tr>
            <tr>
              <td>&nbsp;</td>
              <td><input class="but commit_album" name="" onclick="catimg_save()"  type="button" value="保存"/><span id="T-msg"></span></td>
            </tr>
        </table>
      </form>
    </div>
</div>


<!--mainbody-->
<?php include_once(VIEWPATH."public/footer.php");?>
</body>
<script type="text/javascript" src="<?php echo _get_cfg_path('js')?>jquery-1.11.2.min.js"></script>
<script type="text/javascript" src="<?=_get_cfg_path('js')?>jquery.imgareaselect.js"></script>
<script type="text/javascript" src="<?php echo _get_cfg_path('js')?>common.js"></script>
<script type="text/javascript" src="<?php echo _get_cfg_path('js')?>jquery.SuperSlide.2.1.1.js"></script>
<script>jQuery(".txtScroll-top").slide({titCell:".hd ul",mainCell:".bd ul",autoPage:true,effect:"topLoop",autoPlay:true});</script>
<script type="text/javascript" src="<?php echo _get_cfg_path('js')?>jquery.validate.min.js"></script>
<script type="text/javascript" src="<?php echo _get_cfg_path('lib')?>data/area.js"></script>
<script type="text/javascript" src="<?php echo _get_cfg_path('lib')?>data/multiselect.js"></script>
<script type="text/javascript" src="<?php echo _get_cfg_path('js')?>pages/m/info.js"></script>
<!-- fileupload -->
<script type="text/javascript" src="<?php echo _get_cfg_path('js')?>pages/m/ajaxfileupload.js"></script>
<script src="<?php echo _get_cfg_path('lib')?>uploadify/jquery.uploadify.min.js" type="text/javascript"></script>
<script>
//近照上传
<?php $timestamp = $this->timestamp;?>
$(function() {
	//视频地址
	<?php if ($o['video'] && strstr($o['video'], 'http://') === false):?>
		$('.upload-btn').parent().addClass('vedio_active');
		$('.add-link').parent().removeClass('vedio_active');
		$("#upload_file_show").html('<?=$o['video']?>');
    	$("#uploadvedio_path").val('<?=$o['video']?>');
		$(".upload_div").show();
		$(".link_div").hide();
	<?php else:?>
    	$('.upload-btn').parent().removeClass('vedio_active');
    	$('.add-link').parent().addClass('vedio_active');
    	$(".upload_div").hide();
    	$(".link_div").show();
		$("input[name='video']").val('<?=$o['video']?>');
	<?php endif;?>

	//提交验证
	$(".pri_video_sub").click(function(){
		var vedio = $.trim($("input[name='video']").val());
		if(vedio != '' && vedio != undefined)
		{
			if(vedio.indexOf('.swf')<0)
			{
				if(vedio.indexOf('tudou.com')<0 && vedio.indexOf('youku.com')<0 && vedio.indexOf('ku6.com')<0)
				{
					alert('目前不支持此视频');
					return false;
				}
			}
		}
	});

	
  setTimeout(function(){
    // 近照上传
    $('#photo_upload').uploadify({
        'formData'     : {
        'timestamp' : '<?php echo $timestamp;?>',
        'token'     : '<?php echo md5($this->config->item('encryption_key') . $timestamp );?>',
        'type' : 'recent',
        'uid' : <?php echo $this->loginID;?>
      },
      'auto':true,
      'fileSizeLimit' : '1024KB',
      'buttonText':'选择照片',
      'fileTypeExts': '*.jpg;*.png;*.jpeg',
      'swf'      : '<?php echo _get_cfg_path("lib")?>uploadify/uploadify.swf',
      'uploader' : '/public/upload/uploadimg',
      'multi':false,
      'onUploadSuccess' : function(file, data, response) {
        if (!data){
         alert('上传失败');
         return;
        }
        data = data.split('|');
        if (data[0] == 100){
          $('#recent').nextAll('em').html('<i class="icoErr16"></i>'+data[1]);
        }else if(data[0] == 200 && data[1]!=''){
          var imgpath=data[1];
          $('#recent').val(imgpath);
          $('#recent').nextAll('em').html('<i class="icoCor16"></i>');
          //$('#recent_photo').html('保存后可查看');
		  $('#show_idnoimg3').attr('src','/'+imgpath);
        }
      }
    });
    
    $('#card_upload').uploadify({
      'formData'     : {
        'timestamp' : '<?php echo $timestamp;?>',
        'token'     : '<?php echo md5($this->config->item('encryption_key') . $timestamp );?>',
        'type' : 'card',
        'uid' : <?php echo $this->loginID;?>
      },
      'auto':true,
      //'buttonClass':'inp_btn',
      'fileSizeLimit' : '1024KB',
      'buttonText':'选择照片',
      'fileTypeExts': '*.jpg;*.png;*.jpeg',
      //'buttonImage' : '{$js_url}uploadify/button.png',
      'swf'      : '<?php echo _get_cfg_path("lib")?>uploadify/uploadify.swf',
      'uploader' : '/public/upload/uploadimg',
      'multi':false,
      'onUploadSuccess' : function(file, data, response) {
        if (!data){
         alert('上传失败');
         return;
        }
        data = data.split('|');
        if (data[0] == 100){
          $('#card').nextAll('em').html('<i class="icoErr16"></i>'+data[1]);
        }else if(data[0] == 200 && data[1]!=''){
          var imgpath=data[1];
          $('#card').val(imgpath);
          $('#card').nextAll('em').html('<i class="icoCor16"></i>');
          //$('#show_card').html('<a href="/'+imgpath+'" target="_blank">查看</a>');
          //$('#show_card').html('保存后可查看');
		  $('#show_idnoimg4').attr('src','/'+imgpath);
        }
      }
    });
  },10);
});

<?php $timestamp = time();?>
$(function() {
	$('#file_upload').uploadify({
		'formData'     : {
			'timestamp' : '<?php echo $timestamp;?>',
			'token'     : '<?php echo md5($this->config->item('encryption_key') . $timestamp);?>',
			'usertype':<?php echo $o['usertype'];?>,
			'uid' : <?php echo $this->loginID;?>
		},
		'auto':true,
		'fileSizeLimit' : '100MB',
		'swf'      : '<?php echo _get_cfg_path("lib")?>uploadify/uploadify.swf',
		'uploader' : '/public/upload/uploadvedio',
		'buttonText': '选择上传文件',
		'method' : 'Post',
		'fileTypeDesc' : '视频文件',
		'fileTypeExts' : '*.avi; *.mp4;',
		'multi':false,
	    'onUploadSuccess' : function(file, data, response) {
	    	if (!data){
            	alert('上传失败');
            	return;
            }
            data = data.split('|');
            if(data[0] == 200 && data[1] != '')
            {
            	$("#upload_file_show").html(data[1]);
            	$("#uploadvedio_path").val(data[1]);
            }
            else
            {
            	$("#upload_file_show").html('');
            	$("#uploadvedio_path").val('');
            }
		}
	});
});
</script>
</html>